package br.com.ozsolucoes.util;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;

public class Utilitarios  {

	public Utilitarios() {
	}

	@SuppressWarnings({ "unused", "deprecation" })
	public static String gerarNumeroTicket() {
		long nuTicket;
		Date data = new Date();
		int ano = data.getYear() + 1900;
		int mes = data.getMonth() + 1;
		int dia = data.getDate();
		int horas = data.getHours();
		int minutos = data.getMinutes();
		int segundos = data.getSeconds();
		String ip = "";
		try {
			ip = InetAddress.getLocalHost().getHostAddress();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		ip = ip.replace(".", "");
		String numeroTicket = String.valueOf(ano).concat(
				String.valueOf(mes).concat(String.valueOf(dia).concat(String.valueOf(horas).concat(String.valueOf(horas).concat(String.valueOf(segundos).concat(ip))))));
		return numeroTicket;
	}

	public static String removerMascaraCpf(String cpf) {
		return cpf.replace(".", "").replace("-", "");
	}

	public static String removerMascaraCnpj(String cnpj) {
		return cnpj.replace(".", "").replace("/", "").replace("-", "");
	}

}
